<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<!-- Tell the browser to be responsive to screen width -->
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">

<#include "../common/header.html">

</head>
<body class="hold-transition skin-blue sidebar-mini">
	<OBJECT id="myActivex"
		classid="clsid:46059496-E96D-45D7-9DB4-2240411F1AF1"
		codebase="/embed/gzyct_ytp.cab#version=1,0,0,10" width="0" height="0"></OBJECT>
	<div class="wrapper">

		<!-- 	顶部和左侧菜单的jsp s -->
		<#include "../common/menu.html">
		<!-- 	顶部和左侧菜单的jsp e -->

		<!-- Content Wrapper. Contains page content -->
		<div class="content-wrapper">
			<!-- Content Header (Page header) -->
			<section class="content-header">
				<h1>重置密码</h1>
			</section>



			<!-- Main content -->
			<section class="content" style="padding-bottom: 0px;" id="content">
				<!-- general form elements -->
				<div class="box box-primary" style="width: 1000px; margin: 0 auto;">
					<div class="box-header with-border">
						<h3 class="box-title">重置密码</h3>
					</div>
					<!-- /.box-header -->
					<!-- form start -->
					<form role="form"  action="/cloudpay/admin/resetPasswordAction" method="post" id="conditionForm">
						<input type="hidden" id="md5NewPassword" name="md5NewPassword" />
						<div class="box-body">
							<div class="form-group">
								<label for="exampleInputPort">原密码</label>
								<input type="password" class="form-control" id="oldPassword" name="oldPassword" />
							</div>
							<div class="form-group">
								<label for="phone">新密码</label> 
								<input type="password" class="form-control" id="newPassword" name="newPassword" />
							</div>
							<div class="form-group">
								<label for="cardNumber">确认新密码</label> 
								<input type="password" class="form-control" id="confirmPassword" name="confirmPassword" />
							</div>
					
							
						</div>
						<!-- /.box-body -->

						<div class="box-footer">			
							<button type="submit" class="btn btn-primary">提交</button>
						    <button type="reset" class="btn btn-primary" >清空</button>
						</div>
					</form>
				</div>
				<!-- /.box -->
			</section>
			<!-- /.content -->
		</div>

	</div>
	<!-- ./wrapper -->
	
	<!-- 引入md5加密文件 -->
	<script src="${resurcePath}/cloudpay/js/md5/md5.min.js"></script>
</body>
<script>

var formValidator = null;
$(function () {
	   
	   //校验器
		formValidator = $("#conditionForm").validate(
				{
					onkeyup : false,
					focusInvalid : false,  //错误时,错误选项不会得到焦点
					focusCleanup : true,   //得到焦点时，清空错误提示信息
					submitHandler : function() { //表单提交句柄,为一回调函数，带一个参数：form
						var newPassword = $("#newPassword").val();
							
						//md5加密后再传到后台
						$("#md5NewPassword").val(md5(newPassword).toUpperCase());					
						$("#conditionForm").submit();
					},
					rules : {						
						oldPassword : {
							required:true,
							remote: {
							    url: "/cloudpay/admin/validateOldPassword",     //后台处理程序
							    type: "post",               //数据发送方式
							    dataType: "json",       //接受数据格式   	
							    data: {                     //要传递的数据
							        oldPassword: function() {
							            return md5($("#oldPassword").val());
							        }
							    }
							}
						},
						newPassword : {
							required:true
						},
						confirmPassword : {
							required:true,
							eqAnoInput : "#newPassword"
						}
					},
					messages : {
						
						oldPassword : {
							required:	"原密码不能为空",
							remote:		"原密码错误"
						},
						newPassword : {
							required:"新密码不能为空"
						},
						confirmPassword : {
						    required:"确认密码不能为空",
						    eqAnoInput : "新密码两次输入不相等"
						}
					}
				});
});


</script>

<script src="${resurcePath}/cloudpay/js/common/dataTable.js"></script>

</html>